<template>
    <div>

        <a-button type="primary" @click="addwork">创建工单</a-button>
        
        <br><br>

        <div v-for="(cate, index) in catelist" :key="index">
            <a :href="'/cate_detail?id='+cate.id">{{cate.name}}</a>
        </div>

    </div>
</template>

<script>
export default {
    data() {
        return {
            catelist:[]
        }
    },

    mounted:function(){
        this.axios.get("http://localhost:8000/get_cate/").then(res=>{
            console.log(res.data)
            this.catelist = res.data
        })
    },

    methods:{
        addwork(){
            this.$router.push({path:'/work_order'})
        }
    }
}
</script>

<style>

</style>